Unit 2 Exercise 1
Exercise 1: Define a Global Property
Objective
To replace hardcoded text in the command line with Global Properties so that the command lines are future proofed should the values need to be changed.
Summary
Create two Global Properties, RUNTIME with a value of 10 and PATH_Windows with a value of C:\Program Files\OpConxps\MSLSAM. For three of the jobs in MY FIRST SCHEDULE, replace the hardcoded text with the newly created properties.
Build MY FIRST SCHEDULE for today, then view the schedule's performance in Processes screen. Verify that the proper values are attributed to the Properties used.
The command line should change from “C:\Program Files\OpConxps\MSLSAM\genericp.exe” -t20 to “[[PATH_Windows]]\genericp.exe” -t[[RUNTIME]].
Instructions
Create the Global Properties
- In the Library > Administration, select Global Properties.
- Click the Add button.
- In the Name field, enter
RUNTIME. - In the Value field, enter
10. - Add this Documentation to the Global Property
- Example: This Global Property will store the number of seconds to run the program.
- Click the Save button.
- Click the Add button on the Global Properties toolbar.
- In the Name textbox, type
PATH_Windows. - In the Value textbox, enter
C:\Program Files\OpConxps\MSLSAM - Add Documentation to the Global Property.
- Example: This Global Property will store the path to the MSLSAM directory.
- Click the Save button on the Global Properties toolbar.
- Close Library.
Modify the Jobs
- Under Library > Administration, select Master Jobs.
- Using the filters, locate and select Windows Job 1 in My First Schedule.
- Click the Edit button.
- Click the Lock icon in the upper right-hand corner.
- Expand Task Details, if not already expanded.
- Locate the Command Line and highlight
C:\Program Files\OpConxps\MSLSAM. - Using either, the Magic Wand or CTRL+SPACE, pull up the Property Selector window.
- Using the Search filter, locate and select the property called
PATH_Windows. - Click OK.
- Locate the Command Line and highlight
10. - Using either, the Magic Wand or CTRL+SPACE, pull up the Property Selector window.
- Using the Search filter, locate and select the property called
RUNTIME. - Click OK.
Your updated Command Line should now look like:
"[[PATH_Windows]]\genericp.exe" -t[[RUNTIME]]
- Click the Save button.
- Repeat steps 14-25 to modify the Command Lines for Windows Job 2 and Windows Job 3.
- Close Library.
Build the Schedule and Validate that the Global Properties are resolved
- Open Operations and click on Schedule Build.
- Validate that today is the date for the From and To fields.
- In the Schedule Build section, select the Released radial button.
- If you built My First Schedule for the entire week, be sure to toggle on Overwrite Existing.
- Select My First Schedule from the Schedule List.
- Click Build
- On the Build Results screen, expand the dropdown menus until you can see and click on My First Schedule.
- Click the My First Schedule link to open the Schedule in Processes.
- Verify that all Jobs Finished OK.
- Right-click on one of the four jobs that were modified.
- In the Job Selection panel, select Job Output.
- Click Refresh.
- Click on the link that appears after the Refresh is complete.
- Look at lines four and five and validate that the Global Properties resolved to
C:\Program Files\OpConxps\MSLSAMand10respectively. - Close the Job Output.
- Close Operations.